/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface ShopCar extends BasicModel<ShopCar> {
  cusCode?: string; // 门店
  busType?: string; // 交易产品类型
  busKey?: string; // 业务ID
  iqty?: number; // 数量
  fprice?: number; // 单价
}

export const shopCarList = (params?: ShopCar | any) =>
  defHttp.get<ShopCar>({ url: adminPath + '/shop/car/shopCar/list', params });

export const shopCarListData = (params?: ShopCar | any) =>
  defHttp.post<Page<ShopCar>>({ url: adminPath + '/shop/car/shopCar/listData', params });

export const shopCarForm = (params?: ShopCar | any) =>
  defHttp.get<ShopCar>({ url: adminPath + '/shop/car/shopCar/form', params });

export const shopCarSave = (params?: any, data?: ShopCar | any) =>
  defHttp.postJson<ShopCar>({ url: adminPath + '/shop/car/shopCar/save', params, data });

export const shopCarDelete = (params?: ShopCar | any) =>
  defHttp.get<ShopCar>({ url: adminPath + '/shop/car/shopCar/delete', params });

export const batchDelete = (params?: ShopCar | any) =>
  defHttp.get<ShopCar>({ url: adminPath + '/shop/car/shopCar/batchDelete', params });
